
package com.market.web.action;

import org.springframework.beans.BeanUtils;

import com.market.bean.Supplier;
import com.market.web.form.SupplierForm;

public class AdminSupEditAction extends BaseAction2
{
    public String execute() throws Exception
    {
        long id = getLong("id");
        Supplier sup = getSupplierService().findById(id);
        if (sup != null)
        {
            SupplierForm supf = new SupplierForm();
            BeanUtils.copyProperties(sup, supf);
            getRequest().setAttribute("supplierForm", supf);
            return SUCCESS;//mapping.findForward("supplier");
        }
        else
        {
            return INPUT;//mapping.getInputForward();
        }
    }
}
